using System.Data.Entity;
using YiCheap.Core.Domain.Products;
using YiCheap.Core.Domain.Shops;
using YiCheap.Data.Mapping;

namespace YiCheap.Data
{
    public class YiCheapContext : DbContext
    {
        static YiCheapContext()
        {
            Database.SetInitializer<YiCheapContext>(null);
        }

		public YiCheapContext()
            : base("name=YiCheapContext")
		{
		}

		public YiCheapContext(string connStr):base(connStr)
		{
		}


        public DbSet<Product> Products{ get; set; }
        public DbSet<Shop> Shops{ get; set; }


        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new ProductMap());
            modelBuilder.Configurations.Add(new ShopMap());
        }
    }
}
